#include "stdafx.h"

#include "Student.h"
#include <iostream>
#include <sstream>

Student::Student(string studentID, string name, string department, string email)
{
    this->SetStudentId(studentID);
    this->SetName(name);
    this->SetEmail(email);
    this->SetDepartment(department);
}

Student::Student(string studentID, string name, int math, int comp, int eng)
{
    this->SetStudentId(studentID);
    this->SetName(name);
    this->SetMaths(math);
    this->SetComputer(comp);
	this->SetEnglish(eng);
}
Student::~Student()
{
    //dtor
}

void Student::Print(){
	std::cout << pStudentId << " "<< pName << " " << maths << " " << computer << " " << english << std::endl;
	return ;
}

void Student::Save(char * content){
	if(content){
		strcpy(content, pStudentId.c_str());
		strcat(content, " ");
		strcat(content, pName.c_str());
		strcat(content, " ");
		char value[16] = {0};
		sprintf(value, "%d", maths);
		strcat(content, value);
		strcat(content, " ");
		sprintf(value, "%d", computer);
		strcat(content, value);
		strcat(content, " ");
		sprintf(value, "%d", english);
		strcat(content, value);
		strcat(content, "\r\n");
	}
}
